1. Field
The disclosed embodiments relate to techniques for improving the performance of computer systems. More specifically, the disclosed embodiments relate to a method and apparatus for using prefetch accuracy information to make decisions about handling prefetches received during program execution.
2. Related Art
Prefetching can significantly improve computer system processor performance by loading cache lines containing instructions or data into a cache memory before the instructions or data are needed. This can prevent the processor from stalling while waiting for the instructions or data. However, prefetches can actually degrade processor performance if they are inaccurate because inaccurate prefetches consume valuable memory bandwidth and also cause cache pollution, both of which can delay actual demand requests.
Some processors attempt to mitigate the problem of prefetches delaying demand requests by implementing a “prefetch-dropping” mechanism. For example, some systems drop prefetch requests directed to a cache if the occupancy of the cache's miss buffer reaches a prescribed threshold. Unfortunately, empirical results show that this type of prefetch-dropping often does not perform well in practice. In fact, system performance can actually be reduced in some cases when prefetch dropping is enabled.
Hence, what is needed is a method and an apparatus for implementing prefetch dropping without the above-described problems.